package com.panda.ziwei.service.impl;

import com.panda.ziwei.dto.BirthInfoDto;
import com.panda.ziwei.service.IAstrolabeService;
import org.springframework.stereotype.Service;

@Service
public class AstrolabeServiceImpl implements IAstrolabeService {

    @Override
    public void initAstrolabeService(String city, int year, int month, int day, int hour, int minute) {
        //通过公历出生日期，计算出农历出生日期，真太阳时出生日期，并初始化出生日期对象
        BirthInfoDto birthInfoDto = BirthInfoDto.buildByGregorianCalendar(city, year, month, day, hour, minute);
        System.out.println("公历生日: " + birthInfoDto.getGregorianCalendar());
        System.out.println("真太阳时: " + birthInfoDto.getTrueSunCalendar());
        System.out.println("农历生日: " + birthInfoDto.getLunarCalendar());
    }

}
